home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 5 / Amiga Plus Sonderheft 1996 #5.iso / programme / xipaint3.2 / xipaint.lzx / XiPaintModule / makeanim.rx < prev    next >
Text File  |  1996-09-09  |  2KB  |  88 lines

  1. /* MakeAnim.rx © by Helmut Hoffmann 1995 */
  2. /* Make HHsYUVSq animation from a directory of pictures */
  3. /* with XiPaint */
  4.  
  5. OPTIONS RESULTS
  6.  
  7. CLOSE(STDERR)
  8. win=OPEN(STDERR,'NIL:')
  9.  
  10. CLOSE(STDOUT)
  11. win=OPEN(STDOUT,'NIL:')
  12.  
  13. OPTIONS FAILAT 21
  14.  
  15. address command
  16.  
  17. 'version hhsxipaintmodkey.library >NIL:'
  18. if rc~=0 then demo=1
  19.          else demo=0
  20.  
  21. CLOSE(STDOUT)
  22. win=OPEN(STDOUT,'CON:0/50//130/MakeAnim.rx/CLOSE')
  23.  
  24. if demo=1 then say "Demo version creates animation in greyscale only!"
  25.  
  26. if ~SHOW('p','xipaint') then do
  27.    say "This script needs a running XiPaint and"
  28.    say "HHsXiPaintMod.xio to create animations"
  29.    'wait 5'
  30.    exit
  31. end
  32.  
  33. if EXISTS('/modules/hhsxipaintmod.xio')=1 then xiopath='/modules/'
  34. else if EXISTS('modules/hhsxipaintmod.xio')=1 then xiopath='modules/'
  35. else if EXISTS('hhsxipaintmod.xio')=1 then xiopath=''
  36. else if EXISTS('/hhsxipaintmod.xio')=1 then xiopath='/'
  37. else do
  38.         say "No hhsxipaintmod.xio found!"
  39.         'wait 5'
  40.         exit
  41.      end
  42.  
  43. xiopath'hhsxipaintmod.xio request ""'
  44. 'requestfile noicons title "Select source directory:" >ENV:HHsYUVAnimSource'
  45. if rc~=0 then exit
  46. 'requestfile savemode noicons pattern ~(#?.info) title "Select animation file:" >ENV:HHsYUVAnimFile'
  47. if rc~=0 then exit
  48.  
  49. 'list $HHsYUVAnimSource pat ~(#?.info) files lformat %f%n >t:HHsAnimList'
  50. 'sort t:HHsAnimList to t:HHsAnimListS'
  51.  
  52. if (open(SourceList,'t:HHsAnimListS','READ')=0) then do
  53.    say "Can't read file list"
  54.    'wait 5'
  55.    exit
  56. end
  57. if (open(DestList,'ENV:HHsYUVAnimFile','READ')=0) then do
  58.    say "Can't read dest file name"
  59.    'wait 5'
  60.    exit
  61. end
  62.  
  63. destanim=READLN(DestList)
  64. destanim=SUBSTR(destanim,2,LENGTH(destanim)-2)
  65.  
  66. say "Creating animation:" destanim
  67.  
  68. last=""
  69.  
  70. DO FOREVER
  71.   sourcefile=READLN(SourceList)
  72.   if length(sourcefile)=0 then do
  73.      say "Finished."
  74.      'wait 5'
  75.      exit
  76.   end
  77.   say "Processing file" sourcefile
  78.   if last="" then xiopath'hhsxipaintmod.xio load name "'sourcefile'" xmax 360 ymax 310'
  79.   else xiopath'hhsxipaintmod.xio load name "'sourcefile'" project "'last'" xmax 360 ymax 310'
  80.   if rc~=0 then exit
  81.  
  82.   last=$HHsXMProjName
  83.  
  84.   xiopath'hhsxipaintmod.xio save name "'destanim'" project "'last'"'
  85.   if rc~=0 then exit
  86. END
  87.  
  88.